<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <?php
            include("../Service/WebClass/report/KeywordService.php");
            $KeywordService = new KeywordService();

            if(isset($_POST['option']))
            {
                $message = $KeywordService->addKeyword();
                echo "<script language='javascript'>alert(\"".$message."\");window.close();</script>";
            }
        ?>
        <title>キーワード追加画面</title>
        <link rel="stylesheet" href="../css/common.css" type="text/css" />
        <script language="JavaScript" src="../js/InputCheck.js" type="text/javascript"></script>
    </head>
    <body>
        <div class="input_area">
            <form name="inputform" method="post">
                <input type="hidden" name="option" value="add"/>
                <table width="100%" border="0" cellpadding="2" cellspacing="0">
                    <tbody><tr>
                            <td align="right">
                                <input class="btn close" onclick="javascript:self.close();" type="button">
                            </td>
                        </tr>
                </tbody></table>
                <table width="100%" border="0" cellpadding="2" cellspacing="0">
                    <tbody><tr>
                            <td align="right">
                                <input class="btn save" value="" onclick="return checkInput_keyword('new')" type="submit">
                            </td>
                        </tr>
                </tbody></table>
                <table class="tbl" width="100%" border="0" cellpadding="4" cellspacing="0">
                    <tbody><tr>

                            <td class="td9" width="150" align="left">媒体</td>
                            <td class="td4 left"><?php echo $_GET['listingName']; ?></td>
                        </tr>
                        <tr>
                            <td class="td9 top" align="left">キャンペーン</td>
                            <td class="td4 border"><?php echo $KeywordService->campaignName;?>
                            </td>
                        </tr>
                        <tr>
                            <td class="td9 top" align="left">広告グループ</td>
                            <td class="td4 border">
                                <?php echo $KeywordService->adGroupName;?>
                            </td>
                        </tr>

                </tbody></table>
                <br>

                <table class="tbl" width="100%" border="0" cellpadding="4" cellspacing="0">
                    <tbody><tr>
                            <td class="td9" width="150" align="left"><span class="required"><strong>キーワード</strong></span></td>
                            <td class="td4 left">
                                <input name="keyword_name" size="80" maxlength="1000" value="<?php echo $_POST['keyword_name'];?>" class="txBox" type="text">
                                <br>キーワードの重複許可

                                <select name="keyword_duplicate" class="txBox">
                                    <option value="0" selected="selected">同一媒体内では許可しない
                                    </option><option value="1">同一キャンペーン内では許可しない
                                    </option><option value="2">同一広告グループ内では許可しない
                                </option></select>
                                <?php
                                    if(isset($_POST['keyword_duplicate']))
                                    {
                                        echo "<script>document.inputform.keyword_duplicate.value={$_POST['keyword_duplicate']};</script>";
                                    }
                                ?>
                            &nbsp;&nbsp;												</td>
                        </tr>
                        <tr>
                            <td class="td9 top" align="left">代替テキスト</td>
                            <td class="td4 border">

                                <input name="alternate_text" size="60" maxlength="100" value="<?php echo $_POST['alternate_text'];?>" class="txBox" type="text">
                            </td>
                        </tr>
                        <tr>
                            <td class="td9 top">スポンサードサーチ</td>
                            <td class="td4 border">
                                <input name="sponsored_search" id="sponsored_search2" value="2" type="radio"><label for="sponsored_search2">部分一致・完全一致</label>
                                <input name="sponsored_search" id="sponsored_search1" value="1" checked="checked" type="radio"><label for="sponsored_search1">完全一致</label>
                                <?php
                                    if($_POST['sponsored_search'] == "2")
                                    {
                                        echo "<script>document.inputform.sponsored_search[0].checked=true;</script>";
                                    }
                                    else
                                    {
                                        echo "<script>document.inputform.sponsored_search[1].checked=true;</script>";
                                    }
                                ?>
                                <br>
                                最高入札額
                                <input name="sponsored_maxbid" size="6" maxlength="10" value="<?php echo $_POST['sponsored_maxbid'];?>" class="txBox" type="text">
                            </td>
                        </tr>
                        <tr>
                            <td class="td9 top" align="left">掲載オン/オフ</td>
                            <td class="td4 border">
                                <input name="status" id="status1" value="1" checked="checked" type="radio"><label for="status1">オン</label>

                                <input name="status" id="status0" value="0" type="radio"><label for="status0">オフ</label>
                                <?php
                                    if($_POST['status'] == "0")
                                    {
                                        echo "<script>document.inputform.status[1].checked=true;</script>";
                                    }
                                    else
                                    {
                                        echo "<script>document.inputform.status[0].checked=true;</script>";
                                    }
                                ?>
                            </td>
                        </tr>
                        <tr>
                            <td class="td9 top" align="left">
                            <strong>ランディング先URL</strong>			</td>
                            <td class="td4 border">
                                <input name="landing_url_keyword" size="60" maxlength="1000" value="<?php echo $_POST['landing_url_keyword'];?>" class="txBox" type="text">

                            </td>
                        </tr>
                </tbody></table>	<table width="100%" border="0" cellpadding="2" cellspacing="0">
                    <tbody><tr>
                            <td align="right">
                                <input class="btn save" value="" onclick="return checkInput_keyword('new')" type="submit">
                            </td>
                        </tr>
                </tbody></table>



            </form>
        </div>
    </body>
</html>
